package com.ox.head.okex.service;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.ox.head.okex.request.FillsRequest;
import com.ox.head.okex.request.OrderRequest;
import com.ox.head.okex.vo.Accounts;
import com.ox.head.okex.vo.FillsVo;
import com.ox.head.okex.vo.OrderVo;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.util.List;

/**
 * @author even
 * @date 2021/5/14 0014 上午 11:45
 * @describe
 * sport 币币交易api客户端
 * api文档地址
 * https://www.okex.win/docs/zh/#account-purchase-redempt
 */
public interface OkSpotApiClient {

    /**
     * 获取币币账户资产列表(仅展示拥有资金的币对)
     * @param
     * @return
     * @ahtor even
     * @since
     */
    Flux<Accounts> getAllWallet();
    /**
     * 单一币种账户信息
     * @param currency
     * @return
     * @ahtor even
     * @since
     */
    Mono<Accounts> getAccounts(String currency);
    /**
     *账单流水查询
     * @param currency
     * @return
     * @ahtor even
     * @since
     */
    Flux<String> getLedger(String currency);


   /**
    * 下单
    * @param orderRequest
    * @return
    * @ahtor even
    * @since
    */
    Mono<OrderVo> postOrder(OrderRequest orderRequest) ;

    /**
     * 批量下单
     * @param orderRequestList
     * @return
     * @ahtor even
     * @since
     */
    Flux<OrderVo> batchOrder(List<OrderRequest> orderRequestList);
    /**
     * 撤销之前下的未完成订单。
     * @param id	  <order_id> or <client_oid>
     * @param instrumentId
     * @return
     * @ahtor even
     * @since
     */
    Mono<OrderVo> cancelOrders(String id,String instrumentId);


    Flux<OrderVo> batchCancelOrders(List<String> ids);
    Mono<String> amendOrder(String instrumentId);

    /**
     * 获取所有成交明细
     * @param fillsRequest
     * @return
     * @ahtor even
     * @since
     */
    Flux<FillsVo> getAllFills(FillsRequest fillsRequest);
}

